namespace ext.data
{
	using System;
	using System.Runtime.CompilerServices;
	using System.Html;
	using System.Collections;
	
	
	/// <summary>
	/// The class encapsulates a connection to the page&apos;s originating domain, allowing requests to be made
	/// either to a configured URL, or to a URL specified at request time.  Requests made by this class are asynchronous, and will return immediately. No data from
	/// the server will be available to the statement immediately following the {@link #request} call.
	/// To process returned data, use a
	/// success callback
	/// in the request options object,
	/// or an {@link #requestcomplete event listener}.  File UploadsFile uploads are not performed using normal &quot;Ajax&quot; techniques, that
	/// is they are not performed using XMLHttpRequests. Instead the form is submitted in the standard
	/// manner with the DOM &amp;lt;form&gt; element temporarily modified to have its
	/// target set to refer
	/// to a dynamically generated, hidden &amp;lt;iframe&gt; which is inserted into the document
	/// but removed after the return data has been gathered.  The server response is parsed by the browser to create the document for the IFRAME. If the
	/// server is...
	/// </summary>
	/// <htmlSummary>
	/// &lt;p&gt;The class encapsulates a connection to the page&apos;s originating domain, allowing requests to be made
	/// either to a configured URL, or to a URL specified at request time.&lt;/p&gt;
	/// &lt;p&gt;Requests made by this class are asynchronous, and will return immediately. No data from
	/// the server will be available to the statement immediately following the {@link #request} call.
	/// To process returned data, use a
	/// &lt;a href=&quot;#request-option-success&quot; ext:member=&quot;request-option-success&quot; ext:cls=&quot;Ext.data.Connection&quot;&gt;success callback&lt;/a&gt;
	/// in the request options object,
	/// or an {@link #requestcomplete event listener}.&lt;/p&gt;
	/// &lt;p&gt;&lt;h3&gt;File Uploads&lt;/h3&gt;&lt;a href=&quot;#request-option-isUpload&quot; ext:member=&quot;request-option-isUpload&quot; ext:cls=&quot;Ext.data.Connection&quot;&gt;File uploads&lt;/a&gt; are not performed using normal &quot;Ajax&quot; techniques, that
	/// is they are &lt;b&gt;not&lt;/b&gt; performed using XMLHttpRequests. Instead the form is submitted in the standard
	/// manner with the DOM &lt;tt&gt;&amp;lt;form&gt;&lt;/tt&gt; element temporarily modified to have its
	/// &lt;a href=&quot;http://www.w3.org/TR/REC-html40/present/frames.html#adef-target&quot;&gt;target&lt;/a&gt; set to refer
	/// to a dynamically generated, hidden &lt;tt&gt;&amp;lt;iframe&gt;&lt;/tt&gt; which is inserted into the document
	/// but removed after the return data has been gathered.&lt;/p&gt;
	/// &lt;p&gt;The server response is parsed by the browser to create the document for the IFRAME. If the
	/// server is using JSON to send the return object, then the
	/// &lt;a href=&quot;http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17&quot;&gt;Content-Type&lt;/a&gt; header
	/// must be set to &quot;text/html&quot; in order to tell the browser to insert the text unchanged into the document body.&lt;/p&gt;
	/// &lt;p&gt;Characters which are significant to an HTML parser must be sent as HTML entities, so encode
	/// &quot;&amp;lt;&quot; as &quot;&amp;amp;lt;&quot;, &quot;&amp;amp;&quot; as &quot;&amp;amp;amp;&quot; etc.&lt;/p&gt;
	/// &lt;p&gt;The response text is retrieved from the document, and a fake XMLHttpRequest object
	/// is created containing a &lt;tt&gt;responseText&lt;/tt&gt; property in order to conform to the
	/// requirements of event handlers and callbacks.&lt;/p&gt;
	/// &lt;p&gt;Be aware that file upload packets are sent with the content type &lt;a href=&quot;http://www.faqs.org/rfcs/rfc2388.html&quot;&gt;multipart/form&lt;/a&gt;
	/// and some server technologies (notably JEE) may require some custom processing in order to
	/// retrieve parameter names and parameter values from the packet content.&lt;/p&gt;
	/// &lt;p&gt;Also note that it&apos;s not possible to check the response code of the hidden iframe, so the success handler will ALWAYS fire.&lt;/p&gt;
	/// </htmlSummary>
	/// <definedin>src\ext-core\src\data\Connection.js</definedin>
	[ScriptName("Connection")]
	[ScriptNamespace("Ext.data")]
	[Imported()]
	public partial class Connection : ext.util.Observable
	{
		
		#region Constructors
		/// <summary>Constructor</summary>
		/// <param name="config">a configuration object.</param>
		public Connection(ext.data.Connection_Configuration config)
		{
		}
		
		/// <summary>Constructor</summary>
		public Connection()
		{
		}
		#endregion
		
		#region Fields
		/// <summary>Fires before a network request is made to retrieve a data object.</summary>
		/// <definedin>src\ext-core\src\data\Connection.js</definedin>
		[ScriptName("beforerequestEventName")]
		public const string BeforerequestEventName = "beforerequest";
		
		/// <summary>Fires if the request was successfully completed.</summary>
		/// <definedin>src\ext-core\src\data\Connection.js</definedin>
		[ScriptName("requestcompleteEventName")]
		public const string RequestcompleteEventName = "requestcomplete";
		
		/// <summary>
		/// Fires if an error HTTP status was returned from the server.
		/// See HTTP Status Code Definitions
		/// for details of HTTP status codes.
		/// </summary>
		/// <htmlSummary>
		/// Fires if an error HTTP status was returned from the server.
		/// See &lt;a href=&quot;http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html&quot;&gt;HTTP Status Code Definitions&lt;/a&gt;
		/// for details of HTTP status codes.
		/// </htmlSummary>
		/// <definedin>src\ext-core\src\data\Connection.js</definedin>
		[ScriptName("requestexceptionEventName")]
		public const string RequestexceptionEventName = "requestexception";
		
		/// <summary>
		/// The default URL to be used for requests to the server. Defaults to undefined.  The url config may be a function which returns the URL to use for the Ajax request. The scope
		/// (this reference) of the function is the scope option passed to the {@link #request} method.
		/// </summary>
		/// <htmlSummary>
		/// &lt;p&gt;The default URL to be used for requests to the server. Defaults to undefined.&lt;/p&gt;
		/// &lt;p&gt;The &lt;code&gt;url&lt;/code&gt; config may be a function which &lt;i&gt;returns&lt;/i&gt; the URL to use for the Ajax request. The scope
		/// (&lt;code&gt;&lt;b&gt;this&lt;/b&gt;&lt;/code&gt; reference) of the function is the &lt;code&gt;scope&lt;/code&gt; option passed to the {@link #request} method.&lt;/p&gt;
		/// </htmlSummary>
		/// <definedin>src\ext-core\src\data\Connection.js</definedin>
		/// <optional>Optional Field</optional>
		[ScriptName("url")]
		public string Url;
		
		/// <summary>
		/// An object containing properties which are used as
		/// extra parameters to each request made by this object. (defaults to undefined)
		/// </summary>
		/// <definedin>src\ext-core\src\data\Connection.js</definedin>
		/// <optional>Optional Field</optional>
		[ScriptName("extraParams")]
		public object ExtraParams;
		
		/// <summary>
		/// An object containing request headers which are added
		/// to each request made by this object. (defaults to undefined)
		/// </summary>
		/// <definedin>src\ext-core\src\data\Connection.js</definedin>
		/// <optional>Optional Field</optional>
		[ScriptName("defaultHeaders")]
		public object DefaultHeaders;
		
		/// <summary>
		/// The default HTTP method to be used for requests.
		/// (defaults to undefined; if not set, but {@link #request} params are present, POST will be used;
		/// otherwise, GET will be used.)
		/// </summary>
		/// <definedin>src\ext-core\src\data\Connection.js</definedin>
		/// <optional>Optional Field</optional>
		[ScriptName("method")]
		public string Method;
		
		/// <summary>The timeout in milliseconds to be used for requests. (defaults to 30000)</summary>
		/// <definedin>src\ext-core\src\data\Connection.js</definedin>
		/// <optional>Optional Field</optional>
		[ScriptName("timeout")]
		public System.Number Timeout;
		
		/// <summary>Whether this request should abort any pending requests. (defaults to false)</summary>
		/// <definedin>src\ext-core\src\data\Connection.js</definedin>
		/// <optional>Optional Field</optional>
		[ScriptName("autoAbort")]
		public bool AutoAbort;
		
		/// <summary>True to add a unique cache-buster param to GET requests. (defaults to true)</summary>
		/// <definedin>src\ext-core\src\data\Connection.js</definedin>
		/// <optional>Optional Field</optional>
		[ScriptName("disableCaching")]
		public bool DisableCaching;
		
		/// <summary>
		/// Change the parameter which is sent went disabling caching
		/// through a cache buster. Defaults to &apos;_dc&apos;
		/// </summary>
		/// <definedin>src\ext-core\src\data\Connection.js</definedin>
		/// <optional>Optional Field</optional>
		[ScriptName("disableCachingParam")]
		public string DisableCachingParam;
		#endregion
		
		#region Methods
		/// <summary>
		/// Sends an HTTP request to a remote server.  Important: Ajax server requests are asynchronous, and this call will
		/// return before the response has been received. Process any returned data
		/// in a callback function.  
		/// Ext.Ajax.request({
		/// url: &apos;ajax_demo/sample.json&apos;,
		/// success: function(response, opts) {
		/// var obj = Ext.decode(response.responseText);
		/// console.dir(obj);
		/// },
		/// failure: function(response, opts) {
		/// console.log(&apos;server-side failure with status code &apos; + response.status);
		/// }
		/// });
		///  To execute a callback function in the correct scope, use the scope option.
		/// </summary>
		/// <htmlSummary>
		/// &lt;p&gt;Sends an HTTP request to a remote server.&lt;/p&gt;
		/// &lt;p&gt;&lt;b&gt;Important:&lt;/b&gt; Ajax server requests are asynchronous, and this call will
		/// return before the response has been received. Process any returned data
		/// in a callback function.&lt;/p&gt;
		/// &lt;pre&gt;&lt;code&gt;
		/// Ext.Ajax.request({
		/// url: &apos;ajax_demo/sample.json&apos;,
		/// success: function(response, opts) {
		/// var obj = Ext.decode(response.responseText);
		/// console.dir(obj);
		/// },
		/// failure: function(response, opts) {
		/// console.log(&apos;server-side failure with status code &apos; + response.status);
		/// }
		/// });
		/// &lt;/code&gt;&lt;/pre&gt;
		/// &lt;p&gt;To execute a callback function in the correct scope, use the &lt;tt&gt;scope&lt;/tt&gt; option.&lt;/p&gt;
		/// </htmlSummary>
		/// <definedin>src\ext-core\src\data\Connection.js</definedin>
		/// <param name="options">
		/// An object which may contain the following properties:&lt;ul&gt;
		/// &lt;li&gt;&lt;b&gt;url&lt;/b&gt; : String/Function (Optional)&lt;div class=&quot;sub-desc&quot;&gt;The URL to
		/// which to send the request, or a function to call which returns a URL string. The scope of the
		/// function is specified by the &lt;tt&gt;scope&lt;/tt&gt; option. Defaults to the configured
		/// &lt;tt&gt;{@link #url}&lt;/tt&gt;.&lt;/div&gt;&lt;/li&gt;
		/// &lt;li&gt;&lt;b&gt;params&lt;/b&gt; : Object/String/Function (Optional)&lt;div class=&quot;sub-desc&quot;&gt;
		/// An object containing properties which are used as parameters to the
		/// request, a url encoded string or a function to call to get either. The scope of the function
		/// is specified by the &lt;tt&gt;scope&lt;/tt&gt; option.&lt;/div&gt;&lt;/li&gt;
		/// &lt;li&gt;&lt;b&gt;method&lt;/b&gt; : String (Optional)&lt;div class=&quot;sub-desc&quot;&gt;The HTTP method to use
		/// for the request. Defaults to the configured method, or if no method was configured,
		/// &quot;GET&quot; if no parameters are being sent, and &quot;POST&quot; if parameters are being sent. Note that
		/// the method name is case-sensitive and should be all caps.&lt;/div&gt;&lt;/li&gt;
		/// &lt;li&gt;&lt;b&gt;callback&lt;/b&gt; : Function (Optional)&lt;div class=&quot;sub-desc&quot;&gt;The
		/// function to be called upon receipt of the HTTP response. The callback is
		/// called regardless of success or failure and is passed the following
		/// parameters:&lt;ul&gt;
		/// &lt;li&gt;&lt;b&gt;options&lt;/b&gt; : Object&lt;div class=&quot;sub-desc&quot;&gt;The parameter to the request call.&lt;/div&gt;&lt;/li&gt;
		/// &lt;li&gt;&lt;b&gt;success&lt;/b&gt; : Boolean&lt;div class=&quot;sub-desc&quot;&gt;True if the request succeeded.&lt;/div&gt;&lt;/li&gt;
		/// &lt;li&gt;&lt;b&gt;response&lt;/b&gt; : Object&lt;div class=&quot;sub-desc&quot;&gt;The XMLHttpRequest object containing the response data.
		/// See &lt;a href=&quot;http://www.w3.org/TR/XMLHttpRequest/&quot;&gt;http://www.w3.org/TR/XMLHttpRequest/&lt;/a&gt; for details about
		/// accessing elements of the response.&lt;/div&gt;&lt;/li&gt;
		/// &lt;/ul&gt;&lt;/div&gt;&lt;/li&gt;
		/// &lt;li&gt;&lt;a id=&quot;request-option-success&quot;&gt;&lt;/a&gt;&lt;b&gt;success&lt;/b&gt; : Function (Optional)&lt;div class=&quot;sub-desc&quot;&gt;The function
		/// to be called upon success of the request. The callback is passed the following
		/// parameters:&lt;ul&gt;
		/// &lt;li&gt;&lt;b&gt;response&lt;/b&gt; : Object&lt;div class=&quot;sub-desc&quot;&gt;The XMLHttpRequest object containing the response data.&lt;/div&gt;&lt;/li&gt;
		/// &lt;li&gt;&lt;b&gt;options&lt;/b&gt; : Object&lt;div class=&quot;sub-desc&quot;&gt;The parameter to the request call.&lt;/div&gt;&lt;/li&gt;
		/// &lt;/ul&gt;&lt;/div&gt;&lt;/li&gt;
		/// &lt;li&gt;&lt;b&gt;failure&lt;/b&gt; : Function (Optional)&lt;div class=&quot;sub-desc&quot;&gt;The function
		/// to be called upon failure of the request. The callback is passed the
		/// following parameters:&lt;ul&gt;
		/// &lt;li&gt;&lt;b&gt;response&lt;/b&gt; : Object&lt;div class=&quot;sub-desc&quot;&gt;The XMLHttpRequest object containing the response data.&lt;/div&gt;&lt;/li&gt;
		/// &lt;li&gt;&lt;b&gt;options&lt;/b&gt; : Object&lt;div class=&quot;sub-desc&quot;&gt;The parameter to the request call.&lt;/div&gt;&lt;/li&gt;
		/// &lt;/ul&gt;&lt;/div&gt;&lt;/li&gt;
		/// &lt;li&gt;&lt;b&gt;scope&lt;/b&gt; : Object (Optional)&lt;div class=&quot;sub-desc&quot;&gt;The scope in
		/// which to execute the callbacks: The &quot;this&quot; object for the callback function. If the &lt;tt&gt;url&lt;/tt&gt;, or &lt;tt&gt;params&lt;/tt&gt; options were
		/// specified as functions from which to draw values, then this also serves as the scope for those function calls.
		/// Defaults to the browser window.&lt;/div&gt;&lt;/li&gt;
		/// &lt;li&gt;&lt;b&gt;timeout&lt;/b&gt; : Number (Optional)&lt;div class=&quot;sub-desc&quot;&gt;The timeout in milliseconds to be used for this request. Defaults to 30 seconds.&lt;/div&gt;&lt;/li&gt;
		/// &lt;li&gt;&lt;b&gt;form&lt;/b&gt; : Element/HTMLElement/String (Optional)&lt;div class=&quot;sub-desc&quot;&gt;The &lt;tt&gt;&amp;lt;form&amp;gt;&lt;/tt&gt;
		/// Element or the id of the &lt;tt&gt;&amp;lt;form&amp;gt;&lt;/tt&gt; to pull parameters from.&lt;/div&gt;&lt;/li&gt;
		/// &lt;li&gt;&lt;a id=&quot;request-option-isUpload&quot;&gt;&lt;/a&gt;&lt;b&gt;isUpload&lt;/b&gt; : Boolean (Optional)&lt;div class=&quot;sub-desc&quot;&gt;&lt;b&gt;Only meaningful when used
		/// with the &lt;tt&gt;form&lt;/tt&gt; option&lt;/b&gt;.
		/// &lt;p&gt;True if the form object is a file upload (will be set automatically if the form was
		/// configured with &lt;b&gt;&lt;tt&gt;enctype&lt;/tt&gt;&lt;/b&gt; &quot;multipart/form-data&quot;).&lt;/p&gt;
		/// &lt;p&gt;File uploads are not performed using normal &quot;Ajax&quot; techniques, that is they are &lt;b&gt;not&lt;/b&gt;
		/// performed using XMLHttpRequests. Instead the form is submitted in the standard manner with the
		/// DOM &lt;tt&gt;&amp;lt;form&gt;&lt;/tt&gt; element temporarily modified to have its
		/// &lt;a href=&quot;http://www.w3.org/TR/REC-html40/present/frames.html#adef-target&quot;&gt;target&lt;/a&gt; set to refer
		/// to a dynamically generated, hidden &lt;tt&gt;&amp;lt;iframe&gt;&lt;/tt&gt; which is inserted into the document
		/// but removed after the return data has been gathered.&lt;/p&gt;
		/// &lt;p&gt;The server response is parsed by the browser to create the document for the IFRAME. If the
		/// server is using JSON to send the return object, then the
		/// &lt;a href=&quot;http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17&quot;&gt;Content-Type&lt;/a&gt; header
		/// must be set to &quot;text/html&quot; in order to tell the browser to insert the text unchanged into the document body.&lt;/p&gt;
		/// &lt;p&gt;The response text is retrieved from the document, and a fake XMLHttpRequest object
		/// is created containing a &lt;tt&gt;responseText&lt;/tt&gt; property in order to conform to the
		/// requirements of event handlers and callbacks.&lt;/p&gt;
		/// &lt;p&gt;Be aware that file upload packets are sent with the content type &lt;a href=&quot;http://www.faqs.org/rfcs/rfc2388.html&quot;&gt;multipart/form&lt;/a&gt;
		/// and some server technologies (notably JEE) may require some custom processing in order to
		/// retrieve parameter names and parameter values from the packet content.&lt;/p&gt;
		/// &lt;/div&gt;&lt;/li&gt;
		/// &lt;li&gt;&lt;b&gt;headers&lt;/b&gt; : Object (Optional)&lt;div class=&quot;sub-desc&quot;&gt;Request
		/// headers to set for the request.&lt;/div&gt;&lt;/li&gt;
		/// &lt;li&gt;&lt;b&gt;xmlData&lt;/b&gt; : Object (Optional)&lt;div class=&quot;sub-desc&quot;&gt;XML document
		/// to use for the post. Note: This will be used instead of params for the post
		/// data. Any params will be appended to the URL.&lt;/div&gt;&lt;/li&gt;
		/// &lt;li&gt;&lt;b&gt;jsonData&lt;/b&gt; : Object/String (Optional)&lt;div class=&quot;sub-desc&quot;&gt;JSON
		/// data to use as the post. Note: This will be used instead of params for the post
		/// data. Any params will be appended to the URL.&lt;/div&gt;&lt;/li&gt;
		/// &lt;li&gt;&lt;b&gt;disableCaching&lt;/b&gt; : Boolean (Optional)&lt;div class=&quot;sub-desc&quot;&gt;True
		/// to add a unique cache-buster param to GET requests.&lt;/div&gt;&lt;/li&gt;
		/// &lt;/ul&gt;&lt;/p&gt;
		/// &lt;p&gt;The options object may also contain any other property which might be needed to perform
		/// postprocessing in a callback because it is passed to callback functions.&lt;/p&gt;
		/// </param>
		/// <returns>
		/// transactionId The id of the server transaction. This may be used
		/// to cancel the request.
		/// </returns>
		[ScriptName("request")]
		public System.Number Request(object options)
		{
			throw new System.Exception("Imported - not implemented");
		}
		
		/// <summary>Determine whether this object has a request outstanding.</summary>
		/// <definedin>src\ext-core\src\data\Connection.js</definedin>
		/// <param name="transactionId">defaults to the last transaction</param>
		/// <returns>True if there is an outstanding request.</returns>
		[ScriptName("isLoading")]
		public bool IsLoading(System.Number transactionId)
		{
			throw new System.Exception("Imported - not implemented");
		}
		
		/// <summary>Determine whether this object has a request outstanding.</summary>
		/// <definedin>src\ext-core\src\data\Connection.js</definedin>
		/// <returns>True if there is an outstanding request.</returns>
		[ScriptName("isLoading")]
		public bool IsLoading()
		{
			throw new System.Exception("Imported - not implemented");
		}
		
		/// <summary>Aborts any outstanding request.</summary>
		/// <definedin>src\ext-core\src\data\Connection.js</definedin>
		/// <param name="transactionId">defaults to the last transaction</param>
		[ScriptName("abort")]
		public void Abort(System.Number transactionId)
		{
			throw new System.Exception("Imported - not implemented");
		}
		
		/// <summary>Aborts any outstanding request.</summary>
		/// <definedin>src\ext-core\src\data\Connection.js</definedin>
		[ScriptName("abort")]
		public void Abort()
		{
			throw new System.Exception("Imported - not implemented");
		}
		#endregion
		
		#region Events
		/// <summary>Fires before a network request is made to retrieve a data object.</summary>
		/// <definedin>src\ext-core\src\data\Connection.js</definedin>
		[ScriptName("beforerequest")]
		public event ext.auto.Delegate_ext_data_Connection_And_System_Object Beforerequest;
		
		/// <summary>Fires if the request was successfully completed.</summary>
		/// <definedin>src\ext-core\src\data\Connection.js</definedin>
		[ScriptName("requestcomplete")]
		public event ext.auto.Delegate_ext_data_Connection_And_System_Object_And_System_Object Requestcomplete;
		
		/// <summary>
		/// Fires if an error HTTP status was returned from the server.
		/// See HTTP Status Code Definitions
		/// for details of HTTP status codes.
		/// </summary>
		/// <htmlSummary>
		/// Fires if an error HTTP status was returned from the server.
		/// See &lt;a href=&quot;http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html&quot;&gt;HTTP Status Code Definitions&lt;/a&gt;
		/// for details of HTTP status codes.
		/// </htmlSummary>
		/// <definedin>src\ext-core\src\data\Connection.js</definedin>
		[ScriptName("requestexception")]
		public event ext.auto.Delegate_ext_data_Connection_And_System_Object_And_System_Object Requestexception;
		#endregion
	}
}
